package ManHinhChinh;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import ManHinhChinh.TaoKetNoi;

public class KiemTra_Search {
	protected Boolean TimDuocDuLieu = false;
	protected String _search = null;
 public void TestSearch(String a , String b, int c)
 {
	 
	 TaoKetNoi s = new TaoKetNoi();
	 Connection con = s.TaoLienKet();
		try {
			Statement stm = con.createStatement();
			ResultSet rs = stm.executeQuery("SELECT * FROM "+b+"");
			while (rs.next())
			{
				String dl;
				dl = rs.getString(c).trim();
				if (dl.equals(a))
				{
					TimDuocDuLieu = true;
					_search = dl;
				}
				
			}
			stm.close(); rs.close();
				
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
		try {
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
 }
}
 

